package com.after.saas.common.model.vo;

import com.after.saas.common.constants.CommonCodeEnum;
import com.after.saas.common.constants.StatusEnum;
import com.after.saas.common.validate.EnumValue;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 用户表
 * </p>
 *
 * @author hjchen
 * @since 2021-05-31
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class UserVO implements Serializable {

    private String id;

    /**
     * 账号
     */
    private String account;

    /**
     * 昵称
     */
    private String nickname;

    /**
     * 用户名
     */
    @NotBlank(message = "用户名不能为空")
    private String username;

    private String password;

    private String salt;

    /**
     * 手机号
     */
    private String mobile;

    /**
     * 邮箱
     */
    private String email;

    /**
     * 部门ID
     */
    private String deptId;

    /**
     * 岗位id
     */
    private String postId;

    /**
     * 部门名称
     */
    private String deptName;

    /**
     * 是否禁用
     */

    @EnumValue(value = StatusEnum.class)
    @NotNull(message = "状态不能为空")
    private Integer status;

    private String createBy;

    private String updateBy;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime updateTime;


    /**
     * 角色id
     */
    private String token;
    private List<String> roles;
    private List<String> permissions;


}
